package com.itheima.health.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.health.pojo.CheckGroup;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface CheckGroupMapper extends BaseMapper<CheckGroup> {

    @Select("select checkitem_id from t_checkgroup_checkitem where checkgroup_id=#{id}")
    int[] findCheckItemIdsbyGroupId(int id);

//    @Insert("insert into t_checkgroup_checkitem values(#{gid},#{checkitemId})")
      @Insert("insert into t_checkgroup_checkitem values(#{gid},#{checkitemId})")
    void addCheckGroupAndCheckItemId(@Param("gid")Integer gid, @Param("checkitemId")Integer checkitemId);

    @Delete("delete from t_checkgroup_checkitem where checkgroup_id=#{id}")
    void deleteCheckItemInfoByGroupId(Integer id);
}
